﻿namespace ConsoleApp2._1014;

public class Student
{
    /*//静态属性
    public static int id;
    //成员属性
    public string name;
    public int age;
    public int score;*/
 
    public string Name { get; set; }
    public string StudentId { get; set; }
    public int Age { get; set; }
    public string Gender { get; set; }
    public string PhoneNumber { get; set; }
    public string HomeAddress { get; set; }

    public Student()
    {
        Name = string.Empty;
        StudentId = string.Empty;
        Age = 0;
        Gender = "未知";
        PhoneNumber = string.Empty;
        HomeAddress = string.Empty;
    }

    public Student(string name, string studentId, int age, string gender, string phoneNumber, string homeAddress)
    {
        Name = name;
        StudentId = studentId;
        Age = age;
        Gender = gender;
        PhoneNumber = phoneNumber;
        HomeAddress = homeAddress;
    }
    public void DisplayInfo()
    {
        Console.WriteLine("=== 学生信息 ===");
        Console.WriteLine($"姓名: {Name}");
        Console.WriteLine($"学号: {StudentId}");
        Console.WriteLine($"年龄: {Age}岁");
        Console.WriteLine($"性别: {Gender}");
        Console.WriteLine($"手机号码: {PhoneNumber}");
        Console.WriteLine($"家庭地址: {HomeAddress}");
    }

    public bool IsAdult()
    {
        return Age >= 18;
    }
    public override string ToString()
    {
        return $"{Name}({StudentId}) - {Age}岁 - {Gender}";
    }
     
   
}